// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.ast.expr.SQLIntegerExpr;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLArchiveTableStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../../../utils/listTran.h"
#include "../SQLName.h"

SQLArchiveTableStatement::SQLArchiveTableStatement()
{
  spIdList = std::make_shared<std::list<SQLIntegerExpr_ptr>>();
  pIdList = std::make_shared<std::list<SQLIntegerExpr_ptr>>();
}
// @Override
void SQLArchiveTableStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLArchiveTableStatement)))
  {
    acceptChild(visitor, this->table);
    acceptChild(visitor, this->type);
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLIntegerExpr, SQLObject>(spIdList);
    acceptChild(visitor, tmp1);
    SQLObject_list_ptr tmp2 = ListTran::tran_class<SQLIntegerExpr, SQLObject>(pIdList);
    acceptChild(visitor, tmp2);
  }
  visitor->endVisit(SharedObject(SQLArchiveTableStatement));
}

SQLName_ptr SQLArchiveTableStatement::getTable()
{
  return table;
}

void SQLArchiveTableStatement::setTable(SQLName_ptr table)
{
  if (table != nullptr)
  {
    table->setParent(SharedObject(SQLArchiveTableStatement));
  }
  this->table = table;
}

SQLName_ptr SQLArchiveTableStatement::getType()
{
  return type;
}

void SQLArchiveTableStatement::setType(SQLName_ptr type)
{
  if (type != nullptr)
  {
    type->setParent(SharedObject(SQLArchiveTableStatement));
  }
  this->type = type;
}

SQLIntegerExpr_list_ptr SQLArchiveTableStatement::getSpIdList()
{
  return spIdList;
}

SQLIntegerExpr_list_ptr SQLArchiveTableStatement::getpIdList()
{
  return pIdList;
}
